package cn.intotw.rdcj.coupons.controller;


import cn.intotw.rdcj.core.bean.DataResponse;
import cn.intotw.rdcj.core.constant.Constants;
import cn.intotw.rdcj.coupons.bean.OrderCreateReqVo;
import cn.intotw.rdcj.flash.api.RdcjFlashApi;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.validation.Valid;

/**
 * @author Chenxiang
 * @Description: 下单接口类
 * @create 2020/4/9 11:02
 * @see RdcjFlashApi
 */
@RestController
@RequestMapping("/rdcj/coupons")
@Api(value = "/rdcj/coupons", tags = {"couponsTag"})
@Slf4j
public class CouponsApiController {

    @ApiOperation(value = "Api-优惠券核销接口", notes = "Api-优惠券核销接口")
    @PostMapping("/v1/createOrder")
    public ModelAndView createOrder(@RequestBody @Valid @ApiParam(name = "优惠券核销信息", value = "传入json格式",
            required = true) OrderCreateReqVo orderCreateReqVo) {
        log.info("hello--------------------------------------------");
        return new ModelAndView(Constants.JSON_DATA_VIEW, DataResponse.successWithResult(orderCreateReqVo));
    }
}